const sql = require('../mysql/config');

module.exports =  async (req,res)=>{
    // console.log("limit ===== " , req.body);
    // 分页按钮
    var pageNum = Number(req.body.num);
    // 每个页面渲染的总条数
    const countNum = 8;
    // 获取每个页面不同的数据
    var boutique = await sql(`select article_id,sort_id,thumb,title,intro from article where sort_id = 1 limit ${ (pageNum-1)*countNum },${countNum}`)
    // console.log(free);
    res.send({
        code:200,
        msg:"课程请求成功",
        boutique
    })
}